package com.tianhui.consignortwofei.interf.impl;

import com.fgs.common.interf.ISelectItemValue;
import com.fgs.common.utils.DateUtil;
import com.tianhui.consignortwofei.interf.ISelectTimeData;
import com.tianhui.consignortwofei.mvp.model.enty.SelectTimeInfo;

import java.util.ArrayList;
import java.util.List;

/**
 * @author fgs
 * @date 2021/4/22
 * @description
 **/
public class LoadingSelectTimeData implements ISelectTimeData {
    @Override
    public List<ISelectItemValue> getLeftTimeData() {
        List<ISelectItemValue> list = new ArrayList<>();
        SelectTimeInfo selectTimeInfo;

        selectTimeInfo = new SelectTimeInfo();
        selectTimeInfo.content = "今天";
        selectTimeInfo.value = getDayDate(0);
        list.add(selectTimeInfo);

        selectTimeInfo = new SelectTimeInfo();
        selectTimeInfo.content = "明天(" + getDayDate("MM-dd", 1) + ")";
        selectTimeInfo.value = getDayDate(1);
        list.add(selectTimeInfo);

        selectTimeInfo = new SelectTimeInfo();
        selectTimeInfo.content = "后天(" + getDayDate("MM-dd", 2) + ")";
        selectTimeInfo.value = getDayDate(2);
        list.add(selectTimeInfo);

        selectTimeInfo = new SelectTimeInfo();
        selectTimeInfo.content = getDayDate("MM-dd", 3);
        selectTimeInfo.value = getDayDate(3);
        list.add(selectTimeInfo);

        selectTimeInfo = new SelectTimeInfo();
        selectTimeInfo.content = getDayDate("MM-dd", 4);
        selectTimeInfo.value = getDayDate(4);
        list.add(selectTimeInfo);

        selectTimeInfo = new SelectTimeInfo();
        selectTimeInfo.content = "一周后";
        selectTimeInfo.value = getDayDate(7);
        list.add(selectTimeInfo);

        return list;
    }

    private String getDayDate(int day) {
        return DateUtil.getTodayDate(day);
    }

    private String getDayDate(String format, int day) {
        return DateUtil.getTodayDate(format, day);
    }

    @Override
    public List<ISelectItemValue> getRightTimeData() {
        List<ISelectItemValue> list = new ArrayList<>();

        SelectTimeInfo selectTimeInfo;

        selectTimeInfo = new SelectTimeInfo();
        selectTimeInfo.content = "凌晨 00:00 - 06:00";
        selectTimeInfo.value = "06:00:00";
        list.add(selectTimeInfo);

        selectTimeInfo = new SelectTimeInfo();
        selectTimeInfo.content = "上午 06:00 - 12:00";
        selectTimeInfo.value = "12:00:00";
        list.add(selectTimeInfo);


        selectTimeInfo = new SelectTimeInfo();
        selectTimeInfo.content = "下午 12:00 - 18:00";
        selectTimeInfo.value = "18:00:00";
        list.add(selectTimeInfo);

        selectTimeInfo = new SelectTimeInfo();
        selectTimeInfo.content = "晚上 18:00 - 24:00";
        selectTimeInfo.value = "23:59:59";
        list.add(selectTimeInfo);

        return list;
    }

    @Override
    public String getTitle() {
        return "装货截止时间";
    }

    @Override
    public String getTip() {
        return "填写准确装货时间，可防司机误抢哦";
    }
}
